﻿@using ORM.Common.Helpers
@model ORM.ViewModels.Questions.SuggestListViewModel
@if (Model.Guides.Count > 0 || Model.Questions.Count > 0)
{
    <div style="padding-left: 7px">
        Các bài viết liên quan:</div>
    <table width="100%">
        <tr>
            @if (Model.Guides.Count > 0)
            {
                if (Model.Questions.Count == 0)
                {
                <td width="100%" style="vertical-align: top">
                    <b>Bài Hướng Dẫn</b><br />
                    @foreach (var item in Model.Guides)
                    {
                        <div><a class="suggestLink" href="/Guide/Details/@item.Id" title="@item.Title">@StringHelper.Truncate(item.Title, 100)</a></div>
                    }
                </td>
                }
                else
                {
                <td width="50%" style="vertical-align: top">
                    <b>Bài Hướng Dẫn</b><br />
                    @foreach (var item in Model.Guides)
                    {
                        <div><a class="suggestLink" href="/Guide/Details/@item.Id" title="@item.Title">@StringHelper.Truncate(item.Title, 65)</a></div>
                    }
                </td>
                }

            }
            @if (Model.Questions.Count > 0)
            {
                if (Model.Guides.Count == 0)
                {
                    <td width="100%" style="vertical-align: top">
                    <b>Câu Hỏi</b><br />
                    @foreach (var item in Model.Questions)
                    {
                        <div><a class="suggestLink" href="/Question/Details/@item.Id" title="@item.Title">@StringHelper.Truncate(item.Title, 100)</a></div>
                    }
                </td>
                }
                else
                {
                    <td width="50%" style="vertical-align: top">
                    <b>Câu Hỏi</b><br />
                    @foreach (var item in Model.Questions)
                    {
                        <div><a class="suggestLink" href="/Question/Details/@item.Id" title="@item.Title">@StringHelper.Truncate(item.Title, 65)</a></div>
                    }
                </td>
                }

            }
        </tr>
    </table>

}
